:root {
        --primary-gradient: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
        --secondary-gradient: linear-gradient(135deg, #f093fb 0%, #f5576c 100%);
        --success-color: #10b981;
        --error-color: #ef4444;
        --warning-color: #f59e0b;
        --text-primary: #1f2937;
        --text-secondary: #6b7280;
        --bg-light: #f9fafb;
        --border-color: #e5e7eb;
        --shadow-sm: 0 1px 2px 0 rgba(0, 0, 0, 0.05);
        --shadow-md: 0 4px 6px -1px rgba(0, 0, 0, 0.1);
        --shadow-lg: 0 10px 15px -3px rgba(0, 0, 0, 0.1);
        --shadow-xl: 0 20px 25px -5px rgba(0, 0, 0, 0.1);
      }

      * {
        margin: 0;
        padding: 0;
        box-sizing: border-box;
      }

      body {
        font-family: "Inter", -apple-system, BlinkMacSystemFont, "Segoe UI",
          Roboto, sans-serif;
        background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
        min-height: 100vh;
        display: flex;
        align-items: center;
        justify-content: center;
        padding: 20px;
        position: relative;
        overflow-x: hidden;
      }

      /* Enhanced animated background */
      .bg-animation {
        position: absolute;
        top: 0;
        left: 0;
        width: 100%;
        height: 100%;
        overflow: hidden;
        z-index: 0;
      }

      .bg-animation::before,
      .bg-animation::after {
        content: "";
        position: absolute;
        width: 400px;
        height: 400px;
        border-radius: 50%;
        background: rgba(255, 255, 255, 0.08);
        animation: float 8s ease-in-out infinite;
      }

      .bg-animation::before {
        top: -200px;
        left: -200px;
        animation-delay: 0s;
      }

      .bg-animation::after {
        bottom: -200px;
        right: -200px;
        animation-delay: 4s;
      }

      @keyframes float {
        0%,
        100% {
          transform: translateY(0px) rotate(0deg) scale(1);
          opacity: 0.8;
        }
        50% {
          transform: translateY(-30px) rotate(180deg) scale(1.1);
          opacity: 0.6;
        }
      }

      .container {
        background: rgba(255, 255, 255, 0.95);
        backdrop-filter: blur(20px);
        border-radius: 24px;
        box-shadow: var(--shadow-xl);
        overflow: hidden;
        width: 100%;
        max-width: 440px;
        position: relative;
        z-index: 1;
        border: 1px solid rgba(255, 255, 255, 0.2);
        transition: all 0.3s ease;
      }

      .container:hover {
        transform: translateY(-5px);
        box-shadow: 0 25px 50px -12px rgba(0, 0, 0, 0.25);
      }

      .header {
        text-align: center;
        padding: 40px 40px 20px;
        background: linear-gradient(
          135deg,
          rgba(102, 126, 234, 0.1) 0%,
          rgba(118, 75, 162, 0.1) 100%
        );
        position: relative;
      }

      .header::before {
        content: "";
        position: absolute;
        top: 0;
        left: 0;
        right: 0;
        height: 4px;
        background: var(--primary-gradient);
      }

      .logo {
        width: 70px;
        height: 70px;
        margin: 0 auto 20px;
        border-radius: 20px;
        display: flex;
        align-items: center;
        justify-content: center;
        font-size: 28px;
        font-weight: 700;
        color: white;
        box-shadow: var(--shadow-lg);
        animation: logoFloat 3s ease-in-out infinite;
        position: relative;
      }

      .logo img {
        width: 70px;
        height: 70px;
        margin: 1 auto 20px;
      }

      .logo::after {
        content: "";
        position: absolute;
        inset: -2px;
        background: var(--primary-gradient);
        border-radius: 22px;
        z-index: -1;
        opacity: 0.3;
        animation: logoPulse 2s ease-in-out infinite;
      }

      @keyframes logoFloat {
        0%,
        100% {
          transform: translateY(0px);
        }
        50% {
          transform: translateY(-8px);
        }
      }

      @keyframes logoPulse {
        0%,
        100% {
          transform: scale(1);
          opacity: 0.3;
        }
        50% {
          transform: scale(1.1);
          opacity: 0.1;
        }
      }

      .brand-title {
        font-size: 32px;
        font-weight: 700;
        color: var(--text-primary);
        margin-bottom: 8px;
        letter-spacing: -0.5px;
        background: var(--primary-gradient);
        -webkit-background-clip: text;
        -webkit-text-fill-color: transparent;
        background-clip: text;
      }

      .brand-subtitle {
        color: var(--text-secondary);
        font-size: 16px;
        font-weight: 400;
      }

      .form-container {
        padding: 20px 40px 40px;
        position: relative;
      }

      .form-toggle {
        display: flex;
        margin-bottom: 32px;
        background: var(--bg-light);
        border-radius: 16px;
        padding: 6px;
        position: relative;
        box-shadow: var(--shadow-sm);
        border: 1px solid var(--border-color);
      }

      .toggle-indicator {
        position: absolute;
        top: 6px;
        left: 6px;
        width: calc(50% - 6px);
        height: calc(100% - 12px);
        background: white;
        border-radius: 12px;
        box-shadow: var(--shadow-md);
        transition: transform 0.4s cubic-bezier(0.4, 0, 0.2, 1);
        z-index: 1;
      }

      .toggle-indicator.signup {
        transform: translateX(100%);
      }

      .toggle-btn {
        flex: 1;
        padding: 16px 20px;
        text-align: center;
        background: transparent;
        border: none;
        border-radius: 12px;
        cursor: pointer;
        font-weight: 600;
        font-size: 15px;
        transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
        color: var(--text-secondary);
        position: relative;
        z-index: 2;
      }

      .toggle-btn.active {
        color: var(--text-primary);
      }

      .form {
        display: none;
        animation: slideIn 0.5s cubic-bezier(0.4, 0, 0.2, 1);
      }

      .form.active {
        display: block;
      }

      @keyframes slideIn {
        from {
          opacity: 0;
          transform: translateY(30px);
        }
        to {
          opacity: 1;
          transform: translateY(0);
        }
      }

      .form-title {
        text-align: center;
        margin-bottom: 8px;
        color: var(--text-primary);
        font-size: 26px;
        font-weight: 700;
        letter-spacing: -0.5px;
      }

      .form-subtitle {
        text-align: center;
        margin-bottom: 32px;
        color: var(--text-secondary);
        font-size: 15px;
        line-height: 1.6;
      }

      .form-group {
        margin-bottom: 24px;
        position: relative;
      }

      .form-label {
        display: block;
        margin-bottom: 8px;
        color: var(--text-primary);
        font-weight: 500;
        font-size: 14px;
      }

      .input-wrapper {
        position: relative;
      }

      .input-icon {
        position: absolute;
        left: 18px;
        top: 50%;
        transform: translateY(-50%);
        color: var(--text-secondary);
        font-size: 16px;
        transition: all 0.3s ease;
        z-index: 2;
      }

      .form-input {
        width: 100%;
        padding: 18px 18px 18px 52px;
        border: 2px solid var(--border-color);
        border-radius: 14px;
        font-size: 16px;
        font-weight: 400;
        transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
        background: white;
        color: var(--text-primary);
      }

      .form-input:focus {
        outline: none;
        border-color: #667eea;
        box-shadow: 0 0 0 4px rgba(102, 126, 234, 0.1);
        transform: translateY(-1px);
      }

      .form-input:focus + .input-icon {
        color: #667eea;
        transform: translateY(-50%) scale(1.1);
      }

      .form-input.error {
        border-color: var(--error-color);
        background: rgba(239, 68, 68, 0.05);
        animation: shake 0.5s ease-in-out;
      }

      .form-input.success {
        border-color: var(--success-color);
        background: rgba(16, 185, 129, 0.05);
      }

      @keyframes shake {
        0%,
        100% {
          transform: translateX(0);
        }
        25% {
          transform: translateX(-5px);
        }
        75% {
          transform: translateX(5px);
        }
      }

      .password-toggle {
        position: absolute;
        right: 18px;
        top: 50%;
        transform: translateY(-50%);
        background: none;
        border: none;
        color: var(--text-secondary);
        cursor: pointer;
        font-size: 16px;
        padding: 6px;
        border-radius: 6px;
        transition: all 0.3s ease;
      }

      .password-toggle:hover {
        color: var(--text-primary);
        background: rgba(0, 0, 0, 0.05);
      }

      .error-message {
        color: var(--error-color);
        font-size: 13px;
        margin-top: 8px;
        display: none;
        animation: errorSlide 0.3s ease;
        font-weight: 500;
      }

      @keyframes errorSlide {
        from {
          opacity: 0;
          transform: translateY(-10px);
        }
        to {
          opacity: 1;
          transform: translateY(0);
        }
      }

      .success-message {
        background: linear-gradient(
          135deg,
          rgba(16, 185, 129, 0.1) 0%,
          rgba(16, 185, 129, 0.05) 100%
        );
        color: var(--success-color);
        padding: 18px;
        border-radius: 14px;
        margin-bottom: 24px;
        display: none;
        text-align: center;
        font-weight: 500;
        font-size: 14px;
        border: 1px solid rgba(16, 185, 129, 0.2);
        animation: successSlide 0.4s ease;
      }

      @keyframes successSlide {
        from {
          opacity: 0;
          transform: translateY(-20px);
        }
        to {
          opacity: 1;
          transform: translateY(0);
        }
      }

      .forgot-password {
        text-align: right;
        margin-bottom: 24px;
      }

      .forgot-password a {
        color: #667eea;
        text-decoration: none;
        font-size: 14px;
        font-weight: 500;
        transition: all 0.3s ease;
        padding: 4px 8px;
        border-radius: 6px;
      }

      .forgot-password a:hover {
        color: #5a67d8;
        background: rgba(102, 126, 234, 0.1);
      }

      .submit-btn {
        width: 100%;
        padding: 18px;
        background: var(--primary-gradient);
        color: white;
        border: none;
        border-radius: 14px;
        font-size: 16px;
        font-weight: 600;
        cursor: pointer;
        transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
        position: relative;
        overflow: hidden;
        box-shadow: var(--shadow-md);
      }

      .submit-btn:hover {
        transform: translateY(-2px);
        box-shadow: var(--shadow-lg);
      }

      .submit-btn:active {
        transform: translateY(0);
      }

      .submit-btn:disabled {
        opacity: 0.7;
        cursor: not-allowed;
        transform: none;
      }

      .btn-content {
        display: flex;
        align-items: center;
        justify-content: center;
        gap: 10px;
        transition: opacity 0.3s ease;
      }

      .loading {
        display: none;
        position: absolute;
        top: 50%;
        left: 50%;
        transform: translate(-50%, -50%);
      }

      .loading::after {
        content: "";
        width: 22px;
        height: 22px;
        border: 2px solid rgba(255, 255, 255, 0.3);
        border-top: 2px solid white;
        border-radius: 50%;
        animation: spin 1s linear infinite;
      }

      @keyframes spin {
        0% {
          transform: rotate(0deg);
        }
        100% {
          transform: rotate(360deg);
        }
      }

      .terms {
        font-size: 13px;
        color: var(--text-secondary);
        text-align: center;
        margin-top: 24px;
        line-height: 1.6;
      }

      .terms a {
        color: #667eea;
        text-decoration: none;
        font-weight: 500;
      }

      .terms a:hover {
        text-decoration: underline;
      }

      /* OTP and other containers */
      .otp-container,
      .forgot-container,
      .reset-container {
        display: none;
        padding: 20px 40px 40px;
      }

      .otp-container.active,
      .forgot-container.active,
      .reset-container.active {
        display: block;
        animation: slideIn 0.5s ease;
      }

      .step-indicator {
        display: flex;
        align-items: center;
        justify-content: center;
        margin-bottom: 24px;
        gap: 12px;
      }

      .step-icon {
        width: 50px;
        height: 50px;
        border-radius: 50%;
        background: var(--primary-gradient);
        display: flex;
        align-items: center;
        justify-content: center;
        color: white;
        font-size: 20px;
        box-shadow: var(--shadow-md);
      }

      .otp-inputs {
        display: flex;
        gap: 12px;
        justify-content: center;
        margin: 32px 0;
      }

      .otp-input {
        width: 55px;
        height: 55px;
        border: 2px solid var(--border-color);
        border-radius: 14px;
        text-align: center;
        font-size: 20px;
        font-weight: 600;
        transition: all 0.3s ease;
        background: white;
      }

      .otp-input:focus {
        outline: none;
        border-color: #667eea;
        box-shadow: 0 0 0 4px rgba(102, 126, 234, 0.1);
        transform: scale(1.05);
      }

      .resend-timer {
        color: var(--text-secondary);
        font-size: 14px;
        margin-top: 20px;
        text-align: center;
      }

      .resend-timer a {
        color: #667eea;
        text-decoration: none;
        font-weight: 500;
      }

      .resend-timer a:hover {
        text-decoration: underline;
      }

      .back-btn {
        background: none;
        border: 2px solid var(--border-color);
        color: var(--text-secondary);
        padding: 14px 24px;
        border-radius: 14px;
        cursor: pointer;
        font-weight: 500;
        transition: all 0.3s ease;
        margin-top: 20px;
        width: 100%;
        font-size: 15px;
      }

      .back-btn:hover {
        border-color: #667eea;
        color: #667eea;
        background: rgba(102, 126, 234, 0.05);
      }

      /* Welcome screen styles */
      .welcome-container {
        display: none;
        text-align: center;
        padding: 40px;
      }

      .welcome-container.active {
        display: block;
        animation: slideIn 0.5s ease;
      }

      .welcome-icon {
        width: 90px;
        height: 90px;
        margin: 0 auto 24px;
        background: var(--primary-gradient);
        border-radius: 50%;
        display: flex;
        align-items: center;
        justify-content: center;
        font-size: 36px;
        color: white;
        animation: successPulse 2s ease-in-out infinite;
        box-shadow: var(--shadow-lg);
      }

      @keyframes successPulse {
        0%,
        100% {
          transform: scale(1);
        }
        50% {
          transform: scale(1.1);
        }
      }

      .welcome-title {
        font-size: 30px;
        font-weight: 700;
        color: var(--text-primary);
        margin-bottom: 12px;
        letter-spacing: -0.5px;
      }

      .welcome-message {
        color: var(--text-secondary);
        font-size: 16px;
        line-height: 1.6;
        margin-bottom: 32px;
      }

      /* Responsive design */
      @media (max-width: 480px) {
        .container {
          margin: 10px;
          border-radius: 20px;
        }

        .header,
        .form-container,
        .otp-container,
        .forgot-container,
        .reset-container {
          padding: 24px;
        }

        .brand-title {
          font-size: 26px;
        }

        .form-title {
          font-size: 22px;
        }

        .otp-inputs {
          gap: 8px;
        }

        .otp-input {
          width: 48px;
          height: 48px;
          font-size: 18px;
        }

        .logo {
          width: 60px;
          height: 60px;
          font-size: 24px;
        }
      }

      /* Enhanced animations */
      .container {
        animation: containerEntry 0.6s cubic-bezier(0.4, 0, 0.2, 1);
      }

      @keyframes containerEntry {
        from {
          opacity: 0;
          transform: translateY(50px) scale(0.9);
        }
        to {
          opacity: 1;
          transform: translateY(0) scale(1);
        }
      }